#lang racket


(provide *2
         /2
         ^2
         
         degrees<-radians
         radians<-degrees
         º
         coterminal
         
         pi/6
         pi/4
         pi/3
         pi/2
         3pi/2
         2pi
         
         sign)


(define (*2 x . args)
  (apply * 2 x args))

(define (/2 x)
  (/ x 2))

(define (^2 x)
  (* x x))


(define (degrees<-radians radians)
  (/ (* radians 180.0) pi))

(define (radians<-degrees degrees)
  (* (/ degrees 180) pi))

(define (º degrees)
  (radians<-degrees degrees))

(define (coterminal radians)
  (let ((k (floor (/ radians 2pi))))
    (- radians (* k 2pi))))


(define pi/6 (/ pi 6))
(define pi/4 (/ pi 4))
(define pi/3 (/ pi 3))
(define pi/2 (/2 pi))
(define 3pi/2 (* 3 pi/2))
(define 2pi (*2 pi))


(define (sign n)
  (cond ((positive? n) 1)
        ((negative? n) -1)
        (else 0)))